Skip to content

Conversation

@amorask-bitwarden
Copy link
Contributor

@amorask-bitwarden amorask-bitwarden commented Jan 9, 2026

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-29604
https://bitwarden.atlassian.net/browse/PM-29605
https://bitwarden.atlassian.net/browse/PM-29606

📔 Objective

This PR provides the data and operations necessary to complete our premium subscription page redesign.

Get Premium Subscription

  • Creates new models that represent a Bitwarden subscription as it's displayed and utilized on the web vault
  • Implements a new query to retrieve that Bitwarden subscription representation for a User
  • Exposes that query through the new GET /account/billing/vnext/subscription endpoint

Reinstate Premium Subscription

  • Migrates the subscription reinstatement process to a command
  • Exposes that command through the new POST /account/billing/vnext/subscription/reinstate endpoint

Pay for New Premium Subscription with PayPal Immediately

  • Introduces a new BraintreeService.PayInvoice method that pays a Stripe invoice with Braintree. Logic mostly taken from the Billing application and refined.
  • Update the CreateCloudHostedPremiumSubscriptionCommand to immediately pay the open invoice with Braintree if the user paid with PayPal.
  • Updates the invoice.created webhook handler to also use the BraintreeService to pay the open invoice, but only for subscription cycling events, not subscription creation events which is now handled by the bullet point above.

Update Premium Storage

  • Modifies the UpdatePremiumStorage command to not use prorations, opting instead to charge and credit the customer immediately when they make storage additions or reductions.
  • Moves the endpoint exposing this command to PUT /account/billing/vnext/subscription/storage

Misc

  • Adds FF removal POIs
  • Runs dotnet format in the last commit

📸 Screenshots

Screen.Recording.2026-01-09.at.1.32.50.PM.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@amorask-bitwarden amorask-bitwarden requested a review from a team as a code owner January 9, 2026 19:31
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Logo
Checkmarx One – Scan Summary & Detailsc702aa97-90e6-4fa9-9a29-de531748de4d

New Issues (1)

Checkmarx found the following issues in this Pull Request

# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM CSRF /src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs: 122
detailsMethod at line 122 of /src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs gets a parameter from a user request from user. This p...
Attack Vector
Fixed Issues (1)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Billing/Controllers/VNext/AccountBillingVNextController.cs: 98

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 58.65922% with 148 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.29%. Comparing base (e705fe3) to head (f7eac25).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../Core/Services/Implementations/BraintreeService.cs 0.00% 73 Missing ⚠️
...criptions/Commands/ReinstateSubscriptionCommand.cs 0.00% 21 Missing ⚠️
.../Core/Billing/Subscriptions/Models/SubscriberId.cs 14.28% 18 Missing ⚠️
...Controllers/VNext/AccountBillingVNextController.cs 20.00% 8 Missing ⚠️
.../Billing/Subscriptions/Models/BitwardenDiscount.cs 68.00% 7 Missing and 1 partial ⚠️
src/Core/Billing/Subscriptions/Models/Cart.cs 58.82% 7 Missing ⚠️
.../Services/Implementations/InvoiceCreatedHandler.cs 0.00% 5 Missing ⚠️
...ng/Models/Requests/Storage/StorageUpdateRequest.cs 0.00% 2 Missing ⚠️
src/Core/Billing/Subscriptions/Models/Storage.cs 91.30% 2 Missing ⚠️
src/Core/Billing/Extensions/DiscountExtensions.cs 50.00% 0 Missing and 1 partial ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6821      +/-   ##
==========================================
+ Coverage   55.26%   55.29%   +0.02%     
==========================================
  Files        1939     1949      +10     
  Lines       86224    86552     +328     
  Branches     7705     7727      +22     
==========================================
+ Hits        47655    47860     +205     
- Misses      36777    36901     +124     
+ Partials     1792     1791       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amorask-bitwarden amorask-bitwarden added the ai-review Request a Claude code review label Jan 9, 2026
@amorask-bitwarden amorask-bitwarden merged commit cfa8d4a into main Jan 12, 2026
47 checks passed
@amorask-bitwarden amorask-bitwarden deleted the billing/PM-29604/premium-subscription-page-redesign branch January 12, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants